
#include "Shlwapi.h"
using namespace std;
#pragma comment(lib,"shlwapi.lib")

void testPathMatchSpec( void )
{
	// String path name 1.
	char buffer_1[ ] = "C:\\Test\\File.txt";
	char *lpStr1;
	lpStr1 = buffer_1;

	// String path name 2.
	char buffer_2[ ] = "C:\\Test\\File.bmp";
	char *lpStr2;
	lpStr2 = buffer_2;

	// String path name 3.
	char buffer_3[ ] = "*.txt";
	char *lpStr3;
	lpStr3 = buffer_3;

	// String path name 4.
	char buffer_4[ ] = "C:\\Test\\File";
	char *lpStr4;
	lpStr4 = buffer_4;

	// Variable to get the return. 
	// from "PathMatchSpec"
	int retval;

	// Test path name 1.
	retval = PathMatchSpecA( "C:\\Test\\File.txt", "c:\\????\\F.*" );
	cout << "The contents of String 1: " << lpStr1
		<< "\nThe return value from the function is " << retval << endl;

	// Test path name 2.
	retval = PathMatchSpecA( lpStr2, "*.bmp" );
	cout << "The contents of String 2: " << lpStr2
		<< "\nThe return value from the function is " << retval << " = TRUE" << endl;

	// Test path name 4.
	retval = PathMatchSpecA( lpStr4, lpStr2 );
	cout << "The contents of String 4: " << lpStr4
		<< "\nThe return value from the function is " << retval << " = FALSE" << endl;
}